/**
 * Copyright (c) 2018 小润科技 All rights reserved.

 * 版权所有，侵权必究！
 */

package com.xr.sy.modules.business.dto;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.xr.common.validator.group.AddGroup;
import com.xr.common.validator.group.DefaultGroup;
import com.xr.common.validator.group.UpdateGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import java.io.Serializable;
import java.util.Date;

/**
 * 新闻管理
 */
@Data
@ApiModel(value = "公告")
public class QuestionDTO implements Serializable {

    @ApiModelProperty(value = "id")
    @Null(message="{id.null}", groups = AddGroup.class)
    @NotNull(message="{id.require}", groups = UpdateGroup.class)
    private Long id;

    @ApiModelProperty(value = "标题")
    @NotBlank(message="标题不能为空", groups = DefaultGroup.class)
    private String title;

    @ApiModelProperty(value = "内容")
    @NotBlank(message="内容不能为空", groups = DefaultGroup.class)
    private String content;

    @ApiModelProperty(value = "发布时间")
    private Date pubDate;

    @ApiModelProperty(value = "创建时间")
    @JsonProperty(access = JsonProperty.Access.READ_ONLY)
    private Date createDate;

    @ApiModelProperty(value = "所属部门id")
    private Long deptId;

    @ApiModelProperty(value = "所属部门名称")
    private String deptName;

    @ApiModelProperty(value = "类型code")
    private String typeCode;

    @ApiModelProperty(value = "类型名称")
    private String typeName;

}
